package com.ljx.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.metadata.CellData;
import com.ljx.excel.domain.ExcelP;

import java.util.Map;

/**
 * @author 李加喜
 * @date 2020/9/24 0024 21:38
 * @Email 1129071273@qq.com
 */
//创建的监听器
public class ExcelListener extends AnalysisEventListener<ExcelP> {
    //一行一行的读取excel里面的内容
    @Override
    public void invoke(ExcelP excelP, AnalysisContext analysisContext) {
        System.out.println("****"+excelP);
    }

    //读取表头内容的信息
    @Override
    public void invokeHead(Map<Integer, CellData> headMap, AnalysisContext context) {
        System.out.println("表头: "+headMap);
    }
    //读取完成之后执行的方法
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
